<?php
  class PNVoteDataArray extends PNObjectArray {
    function PNVoteDataArray($init=null, $where='') {
      $this->PNObject();
    
      $this->_objType       = 'votealert_votedata';
      $this->_objField      = 'id';
      $this->_objPath       = 'form';
      $this->_objJoin[] = array ( 'join_table' => 'votealert_province',
                                  'join_field' => array('id','name'),
                                  'object_field_name' => array('province_id','province_name'),
                                  'compare_field_table' => 'province_id',
                                  'compare_field_join' => 'id'
                                  
      );
      $this->_objJoin[] = array ( 'join_table' => 'votealert_district',
                                  'join_field' => array('id','name'),
                                  'object_field_name' => array('district_id','district_name'),
                                  'compare_field_table' => 'district_id',
                                  'compare_field_join' => 'id'
                                  
      );
      $this->_objJoin[] = array ( 'join_table' => 'votealert_tambon',
                                  'join_field' => array('id','name','code'),
                                  'object_field_name' => array('tambon_id','tambon_name','tambon_code'),
                                  'compare_field_table' => 'tambon_id',
                                  'compare_field_join' => 'id'
                                  
      );
      $this->_objJoin[] = array ( 'join_table' => 'votealert_votetype',
                                  'join_field' => array('id','name'),
                                  'object_field_name' => array('votetype_id','votetype_name'),
                                  'compare_field_table' => 'votetype_id',
                                  'compare_field_join' => 'id'
                                  
      );
      $this->_init($init, $where);
    }
  }
?>